package com.lebang.model;

import java.util.Map;

import com.alibaba.fastjson.JSONObject;
import com.lebang.model.enums.NoticeCategory;
import com.lebang.model.enums.NoticeType;


public class PushNotice {

	/**
	 * 处理方式
	 */
	private NoticeCategory category;
	
	/**
	 * 参数类型
	 */
	private NoticeType type;
	
	/**
	 * 参数
	 */
	private String params;

	public NoticeCategory getCategory() {
		return category;
	}

	public void setCategory(NoticeCategory category) {
		this.category = category;
	}

	public NoticeType getType() {
		return type;
	}

	public void setType(NoticeType type) {
		this.type = type;
	}

	public String getParams() {
		return params;
	}

	public void setParams(String params) {
		this.params = params;
	}
	
	public String payload(NoticeCategory category, NoticeType type, Map<String, Object> params) {
		this.category = category;
		this.type = type;
		if (params!=null) {
			this.params = JSONObject.toJSONString(params);
		}
		else {
			this.params = "";
		}
		return JSONObject.toJSONString(this);
	}
}
